﻿$(function () {
    $('#activity').click(function () {
        ActivityCar();
    });
});
function GetValues() {
    var obj = {};
    obj.carowner = $('#carowner').val();
    obj.carmodel = $('#carmodel').val();
    obj.licenseplate = $('#licenseplate').val();
    obj.drivingnumber = $('#drivingnumber').val();
    obj.enginenumber = $('#enginenumber').val();
    obj.pedestal = $('#pedestal').val();
    obj.mobile = $('#mobile').val();
    return obj;
}

function ActivityCar() {
    $.ajax({
        url: 'ActivityCars',
        data: { "json": JSON.stringify(GetValues()) },
        method: 'POST',
        success: function (result) {
            result = eval('(' + result + ')');
            alert(result.Message);
            if (result.IsSucceed) {
                window.location.reload();
            }
        }
    })
}